<?php
defined("_JEXEC") or die();

class DoskaViewType extends JViewLegacy {
	
	protected $form;
	
	
	public function display($tmpl = null) {
		
		
		/*$model = JModelLegacy::getInstance('newm','doskaModel');
		$this->setModel($model);*/
		
		//$this->form = $this->get('Test','newm');//getTest
		
		$this->form = $this->get('Form');//getForm
		
		$this->item = $this->get('Item');//getItem
		
		
		
		$this->addToolBar();
		$this->setDocument();
		
		parent::display($tmpl);
	}
	
	
	protected function addToolBar () {
		
		$isnew = ($this->item->id == 0);
		
		if($isnew) {
			$title = JText::_('COM_DOSKA_MANEGER_TYPE_NEW_MANEGER_TITLE');
		}
		else {
			
			$title = JText::_('COM_DOSKA_MANEGER_TYPE_EDIT_MANEGER_TITLE');
		}
		
		JToolBarHelper::title($title);
		JToolBarHelper::apply('type.apply');
		JToolBarHelper::save('type.save');
		JToolBarHelper::cancel('type.cancel');
		
		
		
	}
	
	protected function setDocument () {
		
		
		$document = JFactory::getDocument();
		$document->setTitle(JText::_('COM_DOSKA_MANEGER_TYPE_NEW_PAGE_TITLE'));
		$document->addStyleSheet(JUri::root(true).'/media/com_doska/css/style.css');
	}
}
?>